﻿using System.Collections.Generic;
using Ayatta.Contract.Domain;

namespace Ayatta.Contract.Component
{
    #region
    /// <summary>
    /// 商品搜索参数
    /// </summary>
    public class ProductQueryParam
    {
        /// <summary>
        /// 自动补全Id
        /// </summary>
        public int Suggest { get; set; }

        /// <summary>
        /// 关键字
        /// </summary>
        public string Keyword { get; set; }

        /// <summary>
        /// 品牌Id(多个以','分隔)
        /// </summary>
        public string Brand { get; set; }

        /// <summary>
        /// 类目Id(多个以','分隔)
        /// </summary>
        public string Cate { get; set; }

        /// <summary>
        /// 属性
        /// </summary>
        public string Prop { get; set; }

        /// <summary>
        /// 起始价格
        /// </summary>
        public decimal PriceStart { get; set; }

        /// <summary>
        /// 结束价格
        /// </summary>
        public decimal PriceEnd { get; set; }

        /// <summary>
        /// 排序
        /// </summary>
        public ProductQuerySort Sort { get; set; }

        /// <summary>
        /// 标识
        /// </summary>
        public ProductQueryFlag Flag { get; set; }

        /// <summary>
        /// 商品展示风格
        /// </summary>
        public ProductQueryStyle Style { get; set; }

        /// <summary>
        /// 当前页数
        /// </summary>
        public int Page { get; set; }

        /// <summary>
        /// 分页大小
        /// </summary>
        public int PageSize { get; set; }

        /// <summary>
        /// 是否高亮
        /// </summary>
        public bool Highlight { get; set; }

        /// <summary>
        /// 来源
        /// </summary>
        public string From { get; set; }

        /// <summary>
        /// 前一个自动补全Id
        /// </summary>
        public int SuggestPre { get; set; }

        /// <summary>
        /// 前一个关键字
        /// </summary>
        public string KeywordPre { get; set; }

        /// <summary>
        /// 扩展参数
        /// </summary>
        public IDictionary<string, string> Extra { get; set; }
    }

    /// <summary>
    /// 商品搜索排序参数
    /// </summary>
    public enum ProductQuerySort : byte
    {
        /// <summary>
        /// 默认
        /// </summary>
        Default = 0,

        /// <summary>
        /// 人气
        /// </summary>
        Popularoty = 1,

        /// <summary>
        /// 销量
        /// </summary>
        SaleQuantity = 2,

        /// <summary>
        /// 价格降序
        /// </summary>
        PriceDesc = 3,

        /// <summary>
        /// 价格升序
        /// </summary>
        PriceAsc = 4,

        /// <summary>
        /// 最新上架时间
        /// </summary>
        Latest = 5
    }

    /// <summary>
    /// 商品搜索标识参数(包邮,折扣等)
    /// </summary>
    public enum ProductQueryFlag : byte
    {
        Default = 0
    }

    /// <summary>
    /// 商品展示风格
    /// </summary>
    public enum ProductQueryStyle : byte
    {
        Default = 0
    }

    #endregion

    #region

    /// <summary>
    /// 商品搜索统计
    /// </summary>
    public class ProductQueryStatistics
    {
        public IDictionary<string, string> Brands { get; set; }

        public IList<ProductPropItem> PropItems { get; set; }

        public ProductQueryStatistics()
            : this(null, null)
        {

        }

        public ProductQueryStatistics(IDictionary<string, string> brands, IList<ProductPropItem> propItems)
        {
            Brands = brands;
            PropItems = propItems;
        }
    }


    #endregion

    public static class ProductQueryExtension
    {
    }

}